<?php

class mailer_backend_default implements iMailerBackend {
	
	public function __construct () {}
	
	public function send ($address, $subject, $body, $sFromAddress, $sFromName) {
		
		$headers = "To: " . $address . "\r\n";
		
		if ($sFromName == '') {
			$headers .= "From: " . $sFromAddress . "\r\n";
			$headers .= "Reply-To: " . $sFromAddress . "\r\n";
		} else {
			$headers .= "From: " . $sFromName . " <" . $sFromAddress .">\r\n";
			$headers .= "Reply-To: " . $sFromName . " <" . $sFromAddress .">\r\n";
		}
		
		$headers .= "Mime-Version: 1.0\r\n";
		$headers .= "Content-type: text/html; charset=utf-8\r\n";		
		$headers .= "X-Mailer: Explay CMS\r\n";
		
		if (mail ($address, $subject, $body, $headers)) {
			return true;
		}
		
		return false;
	}
	
}